;(function () {
    window.addEventListener('hbuilderxReady', () => {
        hbuilderx.onDidReceiveMessage(msg => {
            if (msg.command == 'onChangeTheme') {
                const style = document.documentElement.style
                for (const key in msg.data) {
                    const value = msg.data[key]
                    style.setProperty('--' + key, value)
                }
            }
        })
    })
})()
